﻿package  
{

	import flash.display.MovieClip;
	import flash.events.Event;
	/**
	 * ...
	 * @author Ivan Lucas & Danilo
	 */
	public class Level extends MovieClip
	{
		/*---------------------------variaveis------------------------------------*/
			var MC_tela							:MovieClip = new MovieClip();
			var MC_FragataP1					:Fragata;
			var MC_tiro							:Tiro;
			
			
			
		/*-------------------------------------------------------------------------*/
		public function Level() 
		{
			
		}
		
		public function iniciarJogo():void
		{
			addChild(MC_tela)
			
			
			MC_FragataP1 = new Fragata();
			MC_FragataP1.x = 200;
			MC_FragataP1.y = stage.stageHeight - 25;
			MC_tela.addChild(MC_FragataP1);			
			
			Main.pegarInstancia().stage.addEventListener(Event.ENTER_FRAME, update, false, 0, true)
			
		}
		
		public function update(e:Event):void 
		{
			if (MC_FragataP1 != null)
			{
				MC_FragataP1.update();
			}
				
			if (MC_tiro != null)
			{
				MC_tiro.update();
			}
			
		}
		
	}

}